package ch4oopexer1;
/*轮船有载重、排水量、航速等属性，有起航，鸣笛、抛锚等方法*/
public class Ship {

    double load;
    double displacement;
    double speed;

    public Ship(double load, double displacement, double speed) {
        this.load = load;
        this.displacement = displacement;
        this.speed = speed;
    }

    public void run(){
        System.out.println("船起航");
    }
    public void whistle(){
        System.out.println("船鸣笛");
    }
    public void dropAnchor(){
        System.out.println("船抛锚");
    }
}
